import { Singleton } from './BaseManager';

export class SkillManager extends Singleton {
  /** 准备释放技能 */
  readyReleaseSkill(skill) {
    const ret = this.checkReleaseRequire(skill);
    if (!ret) return false;

    const targets = this.checkReleaseTargets(skill, []);
    if (targets.length <= 0) return false;

    this.activeReleaseTargets(skill, targets);

    return true;
  }

  /** 1.检查释放条件 */
  checkReleaseRequire(skill) {
    // switch (skill.property.get) {
    //   case value:
    //     break;
    //   default:
    //     break;
    // }
    console.log(skill);
    return true;
  }

  /** 2.检测释放目标 */
  checkReleaseTargets(skill, targets: unknown[]) {
    console.log(skill, targets);
    return targets;
  }

  /** 3.对释放目标造成对应效果 */
  activeReleaseTargets(skill, targets: unknown[]) {
    console.log(skill, targets);
  }
}
